package com.weareint.examples.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.weareint.examples.dto.MaterialDTO;
import com.weareint.common.entity.AbstractEntity;
import com.weareint.common.utils.DateUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 *
 *
 *
 * <pre>
 *     物料
 * </pre>
 *
 * @author Auto Generator
 * @date 2021-07-16
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("material")
@ApiModel(value = "物料", description = "物料")
public class Material extends AbstractEntity<MaterialDTO> {

    @ApiModelProperty(value = "物料名称")
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "物料编码")
    @TableField("code")
    private String code;

    @ApiModelProperty(value = "物料描述")
    @TableField("description")
    private String description;

    @ApiModelProperty(value = "库位")
    @TableField("storage_location")
    private String storageLocation;

    @ApiModelProperty(value = "货位")
    @TableField("storage_detail_location")
    private String storageDetailLocation;

    @ApiModelProperty(value = "备注")
    @TableField("remark")
    private String remark;

    @ApiModelProperty(value = "供应商ID")
    @TableField("supplier_id")
    private Long supplierId;

    @ApiModelProperty(value = "硅片厚度")
    @TableField("thickness")
    private String thickness;

    @ApiModelProperty(value = "硅片类型：L表示单晶，N表示多晶")
    @TableField("type")
    private String type;

    @ApiModelProperty(value = "")
    @TableField("crystal")
    private String crystal;

    @ApiModelProperty(value = "")
    @TableField("bonded")
    private String bonded;

    @ApiModelProperty(value = "")
    @TableField("gride_line")
    private String grideLine;



    public static final String CREATE_TIME ="create_time";

    public static final String UPDATE_TIME ="update_time";

    public static final String CREATOR ="creator";

    public static final String UPDATER ="updater";

    public static final String ID ="id";

    public static final String NAME ="name";

    public static final String CODE ="code";

    public static final String DESCRIPTION ="description";

    public static final String STORAGE_LOCATION ="storage_location";

    public static final String STORAGE_DETAIL_LOCATION ="storage_detail_location";

    public static final String REMARK ="remark";

    public static final String SUPPLIER_ID ="supplier_id";

    public static final String THICKNESS ="thickness";

    public static final String TYPE ="type";

    public static final String CRYSTAL ="crystal";

    public static final String BONDED ="bonded";

    public static final String GRIDE_LINE ="gride_line";


    public static final String[] COLUMNS =
            new String[] {
                    CREATE_TIME,
                    UPDATE_TIME,
                    CREATOR,
                    UPDATER,
                    ID,
                    NAME,
                    CODE,
                    DESCRIPTION,
                    STORAGE_LOCATION,
                    STORAGE_DETAIL_LOCATION,
                    REMARK,
                    SUPPLIER_ID,
                    THICKNESS,
                    TYPE,
                    CRYSTAL,
                    BONDED,
                    GRIDE_LINE
            };

    /**
     *
     *
     * <pre>
     *     创建对应的DTO
     * </pre>
     * @return {@link MaterialDTO}
     */
    @Override
    public MaterialDTO toDTO() {
        MaterialDTO dto = new MaterialDTO();
        dto.setCreateTime(DateUtil.format(this.getCreateTime()));
        dto.setUpdateTime(DateUtil.format(this.getUpdateTime()));
        dto.setCreator(this.getCreator());
        dto.setUpdater(this.getUpdater());
        dto.setId(this.getId());
        dto.setName(this.getName());
        dto.setCode(this.getCode());
        dto.setDescription(this.getDescription());
        dto.setStorageLocation(this.getStorageLocation());
        dto.setStorageDetailLocation(this.getStorageDetailLocation());
        dto.setRemark(this.getRemark());
        dto.setSupplierId(this.getSupplierId());
        dto.setThickness(this.getThickness());
        dto.setType(this.getType());
        dto.setCrystal(this.getCrystal());
        dto.setBonded(this.getBonded());
        dto.setGrideLine(this.getGrideLine());
        return dto;
    }
}
